inspector: show color matrix node details
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Oct 2017 09:24:49 +0000 (11:24 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 23 Oct 2017 09:47:23 +0000 (11:47 +0200)
Show the matrix and the offset for color matrix nodes.

gtk/inspector/recorder.c

index ff59dd7151acbf9e03ff8707a0e904106501e9dd..35150cff1de847eb23531b009c8377a075445031 100644 (file)
@@ -513,13 +513,49 @@ populate_render_node_properties (GtkListStore  *store,
                                child_bounds->origin.y);
         add_text_row (store, "Child Bounds", tmp);
         g_free (tmp);
-     }
+      }
+      break;
+
+    case GSK_COLOR_MATRIX_NODE:
+      {
+        const graphene_matrix_t *matrix = gsk_color_matrix_node_peek_color_matrix (node);
+        const graphene_vec4_t *offset = gsk_color_matrix_node_peek_color_offset (node);
+
+        tmp = g_strdup_printf ("% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f",
+                               graphene_matrix_get_value (matrix, 0, 0),
+                               graphene_matrix_get_value (matrix, 0, 1),
+                               graphene_matrix_get_value (matrix, 0, 2),
+                               graphene_matrix_get_value (matrix, 0, 3),
+                               graphene_matrix_get_value (matrix, 1, 0),
+                               graphene_matrix_get_value (matrix, 1, 1),
+                               graphene_matrix_get_value (matrix, 1, 2),
+                               graphene_matrix_get_value (matrix, 1, 3),
+                               graphene_matrix_get_value (matrix, 2, 0),
+                               graphene_matrix_get_value (matrix, 2, 1),
+                               graphene_matrix_get_value (matrix, 2, 2),
+                               graphene_matrix_get_value (matrix, 2, 3),
+                               graphene_matrix_get_value (matrix, 3, 0),
+                               graphene_matrix_get_value (matrix, 3, 1),
+                               graphene_matrix_get_value (matrix, 3, 2),
+                               graphene_matrix_get_value (matrix, 3, 3));
+        add_text_row (store, "Matrix", tmp);
+        g_free (tmp);
+        tmp = g_strdup_printf ("%.2f %.2f %.2f %.2f",
+                               graphene_vec4_get_x (offset),
+                               graphene_vec4_get_y (offset),
+                               graphene_vec4_get_z (offset),
+                               graphene_vec4_get_w (offset));
+        add_text_row (store, "Offset", tmp);
+        g_free (tmp);
+      }
       break;
 
     case GSK_NOT_A_RENDER_NODE:
     case GSK_CONTAINER_NODE:
     case GSK_TRANSFORM_NODE:
-    case GSK_COLOR_MATRIX_NODE:
     case GSK_CLIP_NODE:
     case GSK_ROUNDED_CLIP_NODE:
     case GSK_SHADOW_NODE: